]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
NotificationDaemon: fix icons for notifications without an app
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sat, 12 Oct 2013 16:50:49 +0000 (18:50 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Sat, 12 Oct 2013 23:23:18 +0000 (01:23 +0200)
NotificationDaemon doesn't pass a gicon to the Notification constructor,
because it calls .update() immediately after, so messageTray.js
calls into Source.createIcon(), which returns null and crashes.
Instead, shortcut the Notification constructor by skipping
.update() completely.

https://bugzilla.gnome.org/show_bug.cgi?id=709998

js/ui/messageTray.js

index d8d1e36a367471e2d49d89a832ce19f1eba00d39..d75a5a94d51a9382dc60fa3006b16df08df75698 100644 (file)
@@ -438,7 +438,12 @@ const Notification = new Lang.Class({
         this._bannerLabel = this._bannerUrlHighlighter.actor;
         this._bannerBox.add_actor(this._bannerLabel);
 
-        this.update(title, banner, params);
+        // If called with only one argument we assume the caller
+        // will call .update() later on. This is the case of
+        // NotificationDaemon, which wants to use the same code
+        // for new and updated notifications
+        if (arguments.length != 1)
+            this.update(title, banner, params);
     },
 
     // update: